### 
# @Author: your name
 # @Date: 2019-12-22 11:16:59
 # @LastEditTime : 2020-01-15 22:45:19
 # @LastEditors  : Please set LastEditors
 # @Description: In User Settings Edit
 # @FilePath: /Mynotes/vuepressDemo/deploy.sh
 ###
#!/usr/bin/env sh

# 确保脚本抛出遇到的错误
set -e

# 生成静态文件
npm run docs:build

# 进入生成的文件夹
cd docs/.vuepress/dist

# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME

git init
git add -A
git commit -m 'deploy 更新'

# 如果发布到 https://<USERNAME>.github.io  USERNAME=你的用户名 
# git push -f git@github.com:HLLJW/HLLJW.github.io.git master

# 如果发布到 https://<USERNAME>.github.io/<REPO>  REPO=github上的项目
git push -f git@github.com:wenshaofeng/myVuepres.git master:gh-pages

cd -